package com.mcp.converter.shared.exception;

/**
 * SQL分析异常
 * 
 * @author zengxiong
 */
public class SqlAnalysisException extends RuntimeException {
    
    private final String code;
    
    public SqlAnalysisException(String message) {
        super(message);
        this.code = "SQL_ANALYSIS_ERROR";
    }
    
    public SqlAnalysisException(String message, Throwable cause) {
        super(message, cause);
        this.code = "SQL_ANALYSIS_ERROR";
    }
    
    public SqlAnalysisException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }
    
    public String getCode() {
        return code;
    }

    /**
     * SQL解析异常
     */
    public static class SQLParseException extends Exception {

        public SQLParseException() {
            super();
        }

        public SQLParseException(String message) {
            super(message);
        }

        public SQLParseException(String message, Throwable cause) {
            super(message, cause);
        }

        public SQLParseException(Throwable cause) {
            super(cause);
        }
    }
}